// Copyright (C) 1953-2022 NUDT
// Verilog module name - response_timestamps_record 
// Version: V4.1.0.20221207
// Created:
//         by - fenglin 
////////////////////////////////////////////////////////////////////////////
// Description:
//         
///////////////////////////////////////////////////////////////////////////

`timescale 1ns / 1ps

module response_timestamps_record 
(
        i_clk                  ,
        i_rst_n                ,
			
        iv_mea_clk         	   ,
		
		i_osm_req_rx_pulse_p0  ,
		i_osm_resp_tx_pulse_p0 ,
		i_osm_req_rx_pulse_p1  ,
		i_osm_resp_tx_pulse_p1 ,
		i_osm_req_rx_pulse_p2  ,
		i_osm_resp_tx_pulse_p2 ,
		i_osm_req_rx_pulse_p3  ,
		i_osm_resp_tx_pulse_p3 ,
		i_osm_req_rx_pulse_p4  ,
		i_osm_resp_tx_pulse_p4 ,
		i_osm_req_rx_pulse_p5  ,
		i_osm_resp_tx_pulse_p5 ,
		i_osm_req_rx_pulse_p6  ,
		i_osm_resp_tx_pulse_p6 ,
		i_osm_req_rx_pulse_p7  ,
		i_osm_resp_tx_pulse_p7 ,
		i_osm_req_rx_pulse_p8  ,
		i_osm_resp_tx_pulse_p8 ,
		i_osm_req_rx_pulse_p9  ,
		i_osm_resp_tx_pulse_p9 ,
		i_osm_req_rx_pulse_p10 ,
		i_osm_resp_tx_pulse_p10,
		i_osm_req_rx_pulse_p11 ,
		i_osm_resp_tx_pulse_p11,
		i_osm_req_rx_pulse_p12 ,
		i_osm_resp_tx_pulse_p12,
		i_osm_req_rx_pulse_p13 ,
		i_osm_resp_tx_pulse_p13,
		i_osm_req_rx_pulse_p14 ,
		i_osm_resp_tx_pulse_p14,
		i_osm_req_rx_pulse_p15 ,
		i_osm_resp_tx_pulse_p15,
		i_osm_req_rx_pulse_p16 ,
		i_osm_resp_tx_pulse_p16,
		i_osm_req_rx_pulse_p17 ,
		i_osm_resp_tx_pulse_p17,
		i_osm_req_rx_pulse_p18 ,
		i_osm_resp_tx_pulse_p18,
		i_osm_req_rx_pulse_p19 ,
		i_osm_resp_tx_pulse_p19,
		i_osm_req_rx_pulse_p20 ,
		i_osm_resp_tx_pulse_p20,
		i_osm_req_rx_pulse_p21 ,
		i_osm_resp_tx_pulse_p21,
		i_osm_req_rx_pulse_p22 ,
		i_osm_resp_tx_pulse_p22,
		i_osm_req_rx_pulse_p23 ,
		i_osm_resp_tx_pulse_p23,
		i_osm_req_rx_pulse_p24 ,
		i_osm_resp_tx_pulse_p24,
		i_osm_req_rx_pulse_p25 ,
		i_osm_resp_tx_pulse_p25,
		i_osm_req_rx_pulse_p26 ,
		i_osm_resp_tx_pulse_p26,
		i_osm_req_rx_pulse_p27 ,
		i_osm_resp_tx_pulse_p27,
		i_osm_req_rx_pulse_p28 ,
		i_osm_resp_tx_pulse_p28,
		i_osm_req_rx_pulse_p29 ,
		i_osm_resp_tx_pulse_p29,
		i_osm_req_rx_pulse_p30 ,
		i_osm_resp_tx_pulse_p30,
		i_osm_req_rx_pulse_p31 ,
		i_osm_resp_tx_pulse_p31,

        ov_t2_p0                  ,					
        ov_t2_p1                  ,	
        ov_t2_p2                  ,	
        ov_t2_p3                  ,	
        ov_t2_p4                  ,	
        ov_t2_p5                  ,	
        ov_t2_p6                  ,	
        ov_t2_p7                  ,	
        ov_t2_p8                  ,
        ov_t2_p9                  ,
        ov_t2_p10                  ,
        ov_t2_p11                  ,
        ov_t2_p12                  ,
        ov_t2_p13                  ,
        ov_t2_p14                  ,
        ov_t2_p15                  ,
        ov_t2_p16                  ,
        ov_t2_p17                  ,
        ov_t2_p18                  ,
        ov_t2_p19                  ,
        ov_t2_p20                  ,
        ov_t2_p21                  ,
        ov_t2_p22                  ,
        ov_t2_p23                  ,
        ov_t2_p24                  ,
        ov_t2_p25                  ,	
        ov_t2_p26                  ,
        ov_t2_p27                  ,
        ov_t2_p28                  ,
        ov_t2_p29                  ,
        ov_t2_p30                  ,
        ov_t2_p31                  ,
		
        ov_t3                  ,				
		o_t3_valid             	
);
// clk & rst
input                  i_clk;
input                  i_rst_n;

input      [79:0]      iv_mea_clk;

input                  i_osm_req_rx_pulse_p0   ;
input                  i_osm_resp_tx_pulse_p0  ;
input                  i_osm_req_rx_pulse_p1   ;
input                  i_osm_resp_tx_pulse_p1  ;
input                  i_osm_req_rx_pulse_p2   ;
input                  i_osm_resp_tx_pulse_p2  ;
input                  i_osm_req_rx_pulse_p3   ;
input                  i_osm_resp_tx_pulse_p3  ;
input                  i_osm_req_rx_pulse_p4   ;
input                  i_osm_resp_tx_pulse_p4  ;
input                  i_osm_req_rx_pulse_p5   ;
input                  i_osm_resp_tx_pulse_p5  ;
input                  i_osm_req_rx_pulse_p6   ;
input                  i_osm_resp_tx_pulse_p6  ;
input                  i_osm_req_rx_pulse_p7   ;
input                  i_osm_resp_tx_pulse_p7  ;
input                  i_osm_req_rx_pulse_p8   ;
input                  i_osm_resp_tx_pulse_p8  ;
input                  i_osm_req_rx_pulse_p9   ;
input                  i_osm_resp_tx_pulse_p9  ;
input                  i_osm_req_rx_pulse_p10  ;
input                  i_osm_resp_tx_pulse_p10 ;
input                  i_osm_req_rx_pulse_p11  ;
input                  i_osm_resp_tx_pulse_p11 ;
input                  i_osm_req_rx_pulse_p12  ;
input                  i_osm_resp_tx_pulse_p12 ;
input                  i_osm_req_rx_pulse_p13  ;
input                  i_osm_resp_tx_pulse_p13 ;
input                  i_osm_req_rx_pulse_p14  ;
input                  i_osm_resp_tx_pulse_p14 ;
input                  i_osm_req_rx_pulse_p15  ;
input                  i_osm_resp_tx_pulse_p15 ;
input                  i_osm_req_rx_pulse_p16  ;
input                  i_osm_resp_tx_pulse_p16 ;
input                  i_osm_req_rx_pulse_p17  ;
input                  i_osm_resp_tx_pulse_p17 ;
input                  i_osm_req_rx_pulse_p18  ;
input                  i_osm_resp_tx_pulse_p18 ;
input                  i_osm_req_rx_pulse_p19  ;
input                  i_osm_resp_tx_pulse_p19 ;
input                  i_osm_req_rx_pulse_p20  ;
input                  i_osm_resp_tx_pulse_p20 ;
input                  i_osm_req_rx_pulse_p21  ;
input                  i_osm_resp_tx_pulse_p21 ;
input                  i_osm_req_rx_pulse_p22  ;
input                  i_osm_resp_tx_pulse_p22 ;
input                  i_osm_req_rx_pulse_p23  ;
input                  i_osm_resp_tx_pulse_p23 ;
input                  i_osm_req_rx_pulse_p24  ;
input                  i_osm_resp_tx_pulse_p24 ;
input                  i_osm_req_rx_pulse_p25  ;
input                  i_osm_resp_tx_pulse_p25 ;
input                  i_osm_req_rx_pulse_p26  ;
input                  i_osm_resp_tx_pulse_p26 ;
input                  i_osm_req_rx_pulse_p27  ;
input                  i_osm_resp_tx_pulse_p27 ;
input                  i_osm_req_rx_pulse_p28  ;
input                  i_osm_resp_tx_pulse_p28 ;
input                  i_osm_req_rx_pulse_p29  ;
input                  i_osm_resp_tx_pulse_p29 ;
input                  i_osm_req_rx_pulse_p30  ;
input                  i_osm_resp_tx_pulse_p30 ;
input                  i_osm_req_rx_pulse_p31  ;
input                  i_osm_resp_tx_pulse_p31 ;

output reg [79:0]      ov_t2_p0                ;					
output reg [79:0]      ov_t2_p1                ;
output reg [79:0]      ov_t2_p2                ;
output reg [79:0]      ov_t2_p3                ;
output reg [79:0]      ov_t2_p4                ;
output reg [79:0]      ov_t2_p5                ;
output reg [79:0]      ov_t2_p6                ;
output reg [79:0]      ov_t2_p7                ;
output reg [79:0]      ov_t2_p8                ;
output reg [79:0]      ov_t2_p9                ;
output reg [79:0]      ov_t2_p10               ;
output reg [79:0]      ov_t2_p11               ;
output reg [79:0]      ov_t2_p12               ;
output reg [79:0]      ov_t2_p13               ;
output reg [79:0]      ov_t2_p14               ;
output reg [79:0]      ov_t2_p15               ;
output reg [79:0]      ov_t2_p16               ;
output reg [79:0]      ov_t2_p17               ;
output reg [79:0]      ov_t2_p18               ;
output reg [79:0]      ov_t2_p19               ;
output reg [79:0]      ov_t2_p20               ;
output reg [79:0]      ov_t2_p21               ;
output reg [79:0]      ov_t2_p22               ;
output reg [79:0]      ov_t2_p23               ;
output reg [79:0]      ov_t2_p24               ;
output reg [79:0]      ov_t2_p25               ;	
output reg [79:0]      ov_t2_p26               ;
output reg [79:0]      ov_t2_p27               ;
output reg [79:0]      ov_t2_p28               ;
output reg [79:0]      ov_t2_p29               ;
output reg [79:0]      ov_t2_p30               ;
output reg [79:0]      ov_t2_p31               ;
		
output reg [79:0]      ov_t3                   ;				
output reg             o_t3_valid              ;		  
//////////////////cycle count///////////////// 
always @(posedge i_clk or negedge i_rst_n) begin
    if(!i_rst_n)begin
	    ov_t2_p0           <= 80'b0;
		ov_t2_p1           <= 80'b0;
		ov_t2_p2           <= 80'b0;
		ov_t2_p3           <= 80'b0;
		ov_t2_p4           <= 80'b0;
		ov_t2_p5           <= 80'b0;
		ov_t2_p6           <= 80'b0;
		ov_t2_p7           <= 80'b0;
		ov_t2_p8           <= 80'b0;
		ov_t2_p9           <= 80'b0;
		ov_t2_p10          <= 80'b0;
		ov_t2_p11          <= 80'b0;
		ov_t2_p12          <= 80'b0;
		ov_t2_p13          <= 80'b0;
		ov_t2_p14          <= 80'b0;
		ov_t2_p15          <= 80'b0;
		ov_t2_p16          <= 80'b0;
		ov_t2_p17          <= 80'b0;
		ov_t2_p18          <= 80'b0;
		ov_t2_p19          <= 80'b0;
		ov_t2_p20          <= 80'b0;
		ov_t2_p21          <= 80'b0;
		ov_t2_p22          <= 80'b0;
		ov_t2_p23          <= 80'b0;
		ov_t2_p24          <= 80'b0;
		ov_t2_p25          <= 80'b0;
		ov_t2_p26          <= 80'b0;
		ov_t2_p27          <= 80'b0;
		ov_t2_p28          <= 80'b0;
		ov_t2_p29          <= 80'b0;
		ov_t2_p30          <= 80'b0;
		ov_t2_p31          <= 80'b0;
		
		ov_t3              <= 80'b0;
		o_t3_valid         <= 1'b0 ;
    end
    else begin
        if(i_osm_req_rx_pulse_p0)begin
		    if(iv_mea_clk[31:0] >= 32'd24)begin
			    ov_t2_p0[79:32]    <= iv_mea_clk[79:32];
				ov_t2_p0[31:0]     <= iv_mea_clk[31:0] - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.
			end
			else begin
			    ov_t2_p0[79:32]    <= iv_mea_clk[79:32] - 1'b1;
				ov_t2_p0[31:0]     <= iv_mea_clk[31:0] + 32'd1000000000 - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.			
			end
	    end
		else begin
            ov_t2_p0 <= ov_t2_p0;
	    end
		
        if(i_osm_req_rx_pulse_p1)begin
		    if(iv_mea_clk[31:0] >= 32'd24)begin
			    ov_t2_p1[79:32]    <= iv_mea_clk[79:32];
				ov_t2_p1[31:0]     <= iv_mea_clk[31:0] - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.
			end
			else begin
			    ov_t2_p1[79:32]    <= iv_mea_clk[79:32] - 1'b1;
				ov_t2_p1[31:0]     <= iv_mea_clk[31:0] + 32'd1000000000 - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.			
			end
	    end
		else begin
            ov_t2_p1 <= ov_t2_p1;
	    end

        if(i_osm_req_rx_pulse_p2)begin
		    if(iv_mea_clk[31:0] >= 32'd24)begin
			    ov_t2_p2[79:32]    <= iv_mea_clk[79:32];
				ov_t2_p2[31:0]     <= iv_mea_clk[31:0] - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.
			end
			else begin
			    ov_t2_p2[79:32]    <= iv_mea_clk[79:32] - 1'b1;
				ov_t2_p2[31:0]     <= iv_mea_clk[31:0] + 32'd1000000000 - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.			
			end
	    end
		else begin
            ov_t2_p2 <= ov_t2_p2;
	    end

        if(i_osm_req_rx_pulse_p3)begin
		    if(iv_mea_clk[31:0] >= 32'd24)begin
			    ov_t2_p3[79:32]    <= iv_mea_clk[79:32];
				ov_t2_p3[31:0]     <= iv_mea_clk[31:0] - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.
			end
			else begin
			    ov_t2_p3[79:32]    <= iv_mea_clk[79:32] - 1'b1;
				ov_t2_p3[31:0]     <= iv_mea_clk[31:0] + 32'd1000000000 - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.			
			end
	    end
		else begin
            ov_t2_p3 <= ov_t2_p3;
	    end

        if(i_osm_req_rx_pulse_p4)begin
		    if(iv_mea_clk[31:0] >= 32'd24)begin
			    ov_t2_p4[79:32]    <= iv_mea_clk[79:32];
				ov_t2_p4[31:0]     <= iv_mea_clk[31:0] - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.
			end
			else begin
			    ov_t2_p4[79:32]    <= iv_mea_clk[79:32] - 1'b1;
				ov_t2_p4[31:0]     <= iv_mea_clk[31:0] + 32'd1000000000 - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.			
			end
	    end
		else begin
            ov_t2_p4 <= ov_t2_p4;
	    end

        if(i_osm_req_rx_pulse_p5)begin
		    if(iv_mea_clk[31:0] >= 32'd24)begin
			    ov_t2_p5[79:32]    <= iv_mea_clk[79:32];
				ov_t2_p5[31:0]     <= iv_mea_clk[31:0] - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.
			end
			else begin
			    ov_t2_p5[79:32]    <= iv_mea_clk[79:32] - 1'b1;
				ov_t2_p5[31:0]     <= iv_mea_clk[31:0] + 32'd1000000000 - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.			
			end
	    end
		else begin
            ov_t2_p5 <= ov_t2_p5;
	    end

        if(i_osm_req_rx_pulse_p6)begin
		    if(iv_mea_clk[31:0] >= 32'd24)begin
			    ov_t2_p6[79:32]    <= iv_mea_clk[79:32];
				ov_t2_p6[31:0]     <= iv_mea_clk[31:0] - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.
			end
			else begin
			    ov_t2_p6[79:32]    <= iv_mea_clk[79:32] - 1'b1;
				ov_t2_p6[31:0]     <= iv_mea_clk[31:0] + 32'd1000000000 - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.			
			end
	    end
		else begin
            ov_t2_p6 <= ov_t2_p6;
	    end

        if(i_osm_req_rx_pulse_p7)begin
		    if(iv_mea_clk[31:0] >= 32'd24)begin
			    ov_t2_p7[79:32]    <= iv_mea_clk[79:32];
				ov_t2_p7[31:0]     <= iv_mea_clk[31:0] - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.
			end
			else begin
			    ov_t2_p7[79:32]    <= iv_mea_clk[79:32] - 1'b1;
				ov_t2_p7[31:0]     <= iv_mea_clk[31:0] + 32'd1000000000 - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.			
			end
	    end
		else begin
            ov_t2_p7 <= ov_t2_p7;
	    end

        if(i_osm_req_rx_pulse_p8)begin
		    if(iv_mea_clk[31:0] >= 32'd24)begin
			    ov_t2_p8[79:32]    <= iv_mea_clk[79:32];
				ov_t2_p8[31:0]     <= iv_mea_clk[31:0] - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.
			end
			else begin
			    ov_t2_p8[79:32]    <= iv_mea_clk[79:32] - 1'b1;
				ov_t2_p8[31:0]     <= iv_mea_clk[31:0] + 32'd1000000000 - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.			
			end
	    end
		else begin
            ov_t2_p8 <= ov_t2_p8;
	    end

        if(i_osm_req_rx_pulse_p9)begin
		    if(iv_mea_clk[31:0] >= 32'd24)begin
			    ov_t2_p9[79:32]    <= iv_mea_clk[79:32];
				ov_t2_p9[31:0]     <= iv_mea_clk[31:0] - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.
			end
			else begin
			    ov_t2_p9[79:32]    <= iv_mea_clk[79:32] - 1'b1;
				ov_t2_p9[31:0]     <= iv_mea_clk[31:0] + 32'd1000000000 - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.			
			end
	    end
		else begin
            ov_t2_p9 <= ov_t2_p9;
	    end

        if(i_osm_req_rx_pulse_p10)begin
		    if(iv_mea_clk[31:0] >= 32'd24)begin
			    ov_t2_p10[79:32]    <= iv_mea_clk[79:32];
				ov_t2_p10[31:0]     <= iv_mea_clk[31:0] - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.
			end
			else begin
			    ov_t2_p10[79:32]    <= iv_mea_clk[79:32] - 1'b1;
				ov_t2_p10[31:0]     <= iv_mea_clk[31:0] + 32'd1000000000 - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.			
			end
	    end
		else begin
            ov_t2_p10 <= ov_t2_p10;
	    end

        if(i_osm_req_rx_pulse_p11)begin
		    if(iv_mea_clk[31:0] >= 32'd24)begin
			    ov_t2_p11[79:32]    <= iv_mea_clk[79:32];
				ov_t2_p11[31:0]     <= iv_mea_clk[31:0] - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.
			end
			else begin
			    ov_t2_p11[79:32]    <= iv_mea_clk[79:32] - 1'b1;
				ov_t2_p11[31:0]     <= iv_mea_clk[31:0] + 32'd1000000000 - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.			
			end
	    end
		else begin
            ov_t2_p11 <= ov_t2_p11;
	    end

        if(i_osm_req_rx_pulse_p12)begin
		    if(iv_mea_clk[31:0] >= 32'd24)begin
			    ov_t2_p12[79:32]    <= iv_mea_clk[79:32];
				ov_t2_p12[31:0]     <= iv_mea_clk[31:0] - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.
			end
			else begin
			    ov_t2_p12[79:32]    <= iv_mea_clk[79:32] - 1'b1;
				ov_t2_p12[31:0]     <= iv_mea_clk[31:0] + 32'd1000000000 - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.			
			end
	    end
		else begin
            ov_t2_p12 <= ov_t2_p12;
	    end

        if(i_osm_req_rx_pulse_p13)begin
		    if(iv_mea_clk[31:0] >= 32'd24)begin
			    ov_t2_p13[79:32]    <= iv_mea_clk[79:32];
				ov_t2_p13[31:0]     <= iv_mea_clk[31:0] - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.
			end
			else begin
			    ov_t2_p13[79:32]    <= iv_mea_clk[79:32] - 1'b1;
				ov_t2_p13[31:0]     <= iv_mea_clk[31:0] + 32'd1000000000 - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.			
			end
	    end
		else begin
            ov_t2_p13 <= ov_t2_p13;
	    end

        if(i_osm_req_rx_pulse_p14)begin
		    if(iv_mea_clk[31:0] >= 32'd24)begin
			    ov_t2_p14[79:32]    <= iv_mea_clk[79:32];
				ov_t2_p14[31:0]     <= iv_mea_clk[31:0] - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.
			end
			else begin
			    ov_t2_p14[79:32]    <= iv_mea_clk[79:32] - 1'b1;
				ov_t2_p14[31:0]     <= iv_mea_clk[31:0] + 32'd1000000000 - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.			
			end
	    end
		else begin
            ov_t2_p14 <= ov_t2_p14;
	    end

        if(i_osm_req_rx_pulse_p15)begin
		    if(iv_mea_clk[31:0] >= 32'd24)begin
			    ov_t2_p15[79:32]    <= iv_mea_clk[79:32];
				ov_t2_p15[31:0]     <= iv_mea_clk[31:0] - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.
			end
			else begin
			    ov_t2_p15[79:32]    <= iv_mea_clk[79:32] - 1'b1;
				ov_t2_p15[31:0]     <= iv_mea_clk[31:0] + 32'd1000000000 - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.			
			end
	    end
		else begin
            ov_t2_p15 <= ov_t2_p15;
	    end

        if(i_osm_req_rx_pulse_p16)begin
		    if(iv_mea_clk[31:0] >= 32'd24)begin
			    ov_t2_p16[79:32]    <= iv_mea_clk[79:32];
				ov_t2_p16[31:0]     <= iv_mea_clk[31:0] - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.
			end
			else begin
			    ov_t2_p16[79:32]    <= iv_mea_clk[79:32] - 1'b1;
				ov_t2_p16[31:0]     <= iv_mea_clk[31:0] + 32'd1000000000 - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.			
			end
	    end
		else begin
            ov_t2_p16 <= ov_t2_p16;
	    end

        if(i_osm_req_rx_pulse_p17)begin
		    if(iv_mea_clk[31:0] >= 32'd24)begin
			    ov_t2_p17[79:32]    <= iv_mea_clk[79:32];
				ov_t2_p17[31:0]     <= iv_mea_clk[31:0] - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.
			end
			else begin
			    ov_t2_p17[79:32]    <= iv_mea_clk[79:32] - 1'b1;
				ov_t2_p17[31:0]     <= iv_mea_clk[31:0] + 32'd1000000000 - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.			
			end
	    end
		else begin
            ov_t2_p17 <= ov_t2_p17;
	    end

        if(i_osm_req_rx_pulse_p18)begin
		    if(iv_mea_clk[31:0] >= 32'd24)begin
			    ov_t2_p18[79:32]    <= iv_mea_clk[79:32];
				ov_t2_p18[31:0]     <= iv_mea_clk[31:0] - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.
			end
			else begin
			    ov_t2_p18[79:32]    <= iv_mea_clk[79:32] - 1'b1;
				ov_t2_p18[31:0]     <= iv_mea_clk[31:0] + 32'd1000000000 - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.			
			end
	    end
		else begin
            ov_t2_p18 <= ov_t2_p18;
	    end

        if(i_osm_req_rx_pulse_p19)begin
		    if(iv_mea_clk[31:0] >= 32'd24)begin
			    ov_t2_p19[79:32]    <= iv_mea_clk[79:32];
				ov_t2_p19[31:0]     <= iv_mea_clk[31:0] - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.
			end
			else begin
			    ov_t2_p19[79:32]    <= iv_mea_clk[79:32] - 1'b1;
				ov_t2_p19[31:0]     <= iv_mea_clk[31:0] + 32'd1000000000 - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.			
			end
	    end
		else begin
            ov_t2_p19 <= ov_t2_p19;
	    end

        if(i_osm_req_rx_pulse_p20)begin
		    if(iv_mea_clk[31:0] >= 32'd24)begin
			    ov_t2_p20[79:32]    <= iv_mea_clk[79:32];
				ov_t2_p20[31:0]     <= iv_mea_clk[31:0] - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.
			end
			else begin
			    ov_t2_p20[79:32]    <= iv_mea_clk[79:32] - 1'b1;
				ov_t2_p20[31:0]     <= iv_mea_clk[31:0] + 32'd1000000000 - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.			
			end
	    end
		else begin
            ov_t2_p20 <= ov_t2_p20;
	    end

        if(i_osm_req_rx_pulse_p21)begin
		    if(iv_mea_clk[31:0] >= 32'd24)begin
			    ov_t2_p21[79:32]    <= iv_mea_clk[79:32];
				ov_t2_p21[31:0]     <= iv_mea_clk[31:0] - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.
			end
			else begin
			    ov_t2_p21[79:32]    <= iv_mea_clk[79:32] - 1'b1;
				ov_t2_p21[31:0]     <= iv_mea_clk[31:0] + 32'd1000000000 - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.			
			end
	    end
		else begin
            ov_t2_p21 <= ov_t2_p21;
	    end

        if(i_osm_req_rx_pulse_p22)begin
		    if(iv_mea_clk[31:0] >= 32'd24)begin
			    ov_t2_p22[79:32]    <= iv_mea_clk[79:32];
				ov_t2_p22[31:0]     <= iv_mea_clk[31:0] - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.
			end
			else begin
			    ov_t2_p22[79:32]    <= iv_mea_clk[79:32] - 1'b1;
				ov_t2_p22[31:0]     <= iv_mea_clk[31:0] + 32'd1000000000 - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.			
			end
	    end
		else begin
            ov_t2_p22 <= ov_t2_p22;
	    end

        if(i_osm_req_rx_pulse_p23)begin
		    if(iv_mea_clk[31:0] >= 32'd24)begin
			    ov_t2_p23[79:32]    <= iv_mea_clk[79:32];
				ov_t2_p23[31:0]     <= iv_mea_clk[31:0] - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.
			end
			else begin
			    ov_t2_p23[79:32]    <= iv_mea_clk[79:32] - 1'b1;
				ov_t2_p23[31:0]     <= iv_mea_clk[31:0] + 32'd1000000000 - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.			
			end
	    end
		else begin
            ov_t2_p23 <= ov_t2_p23;
	    end

        if(i_osm_req_rx_pulse_p24)begin
		    if(iv_mea_clk[31:0] >= 32'd24)begin
			    ov_t2_p24[79:32]    <= iv_mea_clk[79:32];
				ov_t2_p24[31:0]     <= iv_mea_clk[31:0] - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.
			end
			else begin
			    ov_t2_p24[79:32]    <= iv_mea_clk[79:32] - 1'b1;
				ov_t2_p24[31:0]     <= iv_mea_clk[31:0] + 32'd1000000000 - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.			
			end
	    end
		else begin
            ov_t2_p24 <= ov_t2_p24;
	    end

        if(i_osm_req_rx_pulse_p25)begin
		    if(iv_mea_clk[31:0] >= 32'd24)begin
			    ov_t2_p25[79:32]    <= iv_mea_clk[79:32];
				ov_t2_p25[31:0]     <= iv_mea_clk[31:0] - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.
			end
			else begin
			    ov_t2_p25[79:32]    <= iv_mea_clk[79:32] - 1'b1;
				ov_t2_p25[31:0]     <= iv_mea_clk[31:0] + 32'd1000000000 - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.			
			end
	    end
		else begin
            ov_t2_p25 <= ov_t2_p25;
	    end

        if(i_osm_req_rx_pulse_p26)begin
		    if(iv_mea_clk[31:0] >= 32'd24)begin
			    ov_t2_p26[79:32]    <= iv_mea_clk[79:32];
				ov_t2_p26[31:0]     <= iv_mea_clk[31:0] - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.
			end
			else begin
			    ov_t2_p26[79:32]    <= iv_mea_clk[79:32] - 1'b1;
				ov_t2_p26[31:0]     <= iv_mea_clk[31:0] + 32'd1000000000 - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.			
			end
	    end
		else begin
            ov_t2_p26 <= ov_t2_p26;
	    end

        if(i_osm_req_rx_pulse_p27)begin
		    if(iv_mea_clk[31:0] >= 32'd24)begin
			    ov_t2_p27[79:32]    <= iv_mea_clk[79:32];
				ov_t2_p27[31:0]     <= iv_mea_clk[31:0] - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.
			end
			else begin
			    ov_t2_p27[79:32]    <= iv_mea_clk[79:32] - 1'b1;
				ov_t2_p27[31:0]     <= iv_mea_clk[31:0] + 32'd1000000000 - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.			
			end
	    end
		else begin
            ov_t2_p27 <= ov_t2_p27;
	    end

        if(i_osm_req_rx_pulse_p28)begin
		    if(iv_mea_clk[31:0] >= 32'd24)begin
			    ov_t2_p28[79:32]    <= iv_mea_clk[79:32];
				ov_t2_p28[31:0]     <= iv_mea_clk[31:0] - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.
			end
			else begin
			    ov_t2_p28[79:32]    <= iv_mea_clk[79:32] - 1'b1;
				ov_t2_p28[31:0]     <= iv_mea_clk[31:0] + 32'd1000000000 - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.			
			end
	    end
		else begin
            ov_t2_p28 <= ov_t2_p28;
	    end

        if(i_osm_req_rx_pulse_p29)begin
		    if(iv_mea_clk[31:0] >= 32'd24)begin
			    ov_t2_p29[79:32]    <= iv_mea_clk[79:32];
				ov_t2_p29[31:0]     <= iv_mea_clk[31:0] - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.
			end
			else begin
			    ov_t2_p29[79:32]    <= iv_mea_clk[79:32] - 1'b1;
				ov_t2_p29[31:0]     <= iv_mea_clk[31:0] + 32'd1000000000 - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.			
			end
	    end
		else begin
            ov_t2_p29 <= ov_t2_p29;
	    end

        if(i_osm_req_rx_pulse_p30)begin
		    if(iv_mea_clk[31:0] >= 32'd24)begin
			    ov_t2_p30[79:32]    <= iv_mea_clk[79:32];
				ov_t2_p30[31:0]     <= iv_mea_clk[31:0] - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.
			end
			else begin
			    ov_t2_p30[79:32]    <= iv_mea_clk[79:32] - 1'b1;
				ov_t2_p30[31:0]     <= iv_mea_clk[31:0] + 32'd1000000000 - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.			
			end
	    end
		else begin
            ov_t2_p30 <= ov_t2_p30;
	    end

        if(i_osm_req_rx_pulse_p31)begin
		    if(iv_mea_clk[31:0] >= 32'd24)begin
			    ov_t2_p31[79:32]    <= iv_mea_clk[79:32];
				ov_t2_p31[31:0]     <= iv_mea_clk[31:0] - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.
			end
			else begin
			    ov_t2_p31[79:32]    <= iv_mea_clk[79:32] - 1'b1;
				ov_t2_p31[31:0]     <= iv_mea_clk[31:0] + 32'd1000000000 - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.			
			end
	    end
		else begin
            ov_t2_p31 <= ov_t2_p31;
	    end
		
		if(i_osm_resp_tx_pulse_p0 | i_osm_resp_tx_pulse_p1 | i_osm_resp_tx_pulse_p2 | i_osm_resp_tx_pulse_p3 | i_osm_resp_tx_pulse_p4 | i_osm_resp_tx_pulse_p5 | i_osm_resp_tx_pulse_p6 | i_osm_resp_tx_pulse_p7 | i_osm_resp_tx_pulse_p8 | i_osm_resp_tx_pulse_p9 | i_osm_resp_tx_pulse_p10 | i_osm_resp_tx_pulse_p11 | i_osm_resp_tx_pulse_p12 | i_osm_resp_tx_pulse_p13 | i_osm_resp_tx_pulse_p14 | i_osm_resp_tx_pulse_p15 | i_osm_resp_tx_pulse_p16 | i_osm_resp_tx_pulse_p17 | i_osm_resp_tx_pulse_p18 | i_osm_resp_tx_pulse_p19 | i_osm_resp_tx_pulse_p20 | i_osm_resp_tx_pulse_p21 | i_osm_resp_tx_pulse_p22 | i_osm_resp_tx_pulse_p23 | i_osm_resp_tx_pulse_p24 | i_osm_resp_tx_pulse_p25 | i_osm_resp_tx_pulse_p26 | i_osm_resp_tx_pulse_p27 | i_osm_resp_tx_pulse_p28 | i_osm_resp_tx_pulse_p29 | i_osm_resp_tx_pulse_p30 | i_osm_resp_tx_pulse_p31)begin
		    o_t3_valid <= 1'b1;
			if(iv_mea_clk[31:0] >= 32'd24)begin
			    ov_t3[79:32]    <= iv_mea_clk[79:32];
				ov_t3[31:0]     <= iv_mea_clk[31:0] - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.
			end
			else begin
			    ov_t3[79:32]    <= iv_mea_clk[79:32] - 1'b1;
				ov_t3[31:0]     <= iv_mea_clk[31:0] + 32'd1000000000 - 32'd24;//24ns为脉冲产生（1拍）和跨时钟域（2拍）所占用的时间.			
			end
	    end
		else begin
		    o_t3_valid <= 1'b0 ;
            ov_t3      <= ov_t3;
	    end
		
    end
end

endmodule